home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0643A.ZIP
/
SETSET.PRG
< prev
next >
Wrap
Text File
|
1987-04-24
|
4KB
|
166 lines
* SETCOLOR, THIS ALLOWS USER INPUT TO SET THE FIVE COLOR VARIABLES
* USES PUBLIC VARIABLES clr1,clr2,clr3,clr4,clr5,nclr1,nclr2,nclr3,
* nclr4,nclr5,dangerclrs ( BLK/RED - DANGER! (file overwrite, etc))
* Use "SET COLOR TO &clr1/&clr2,&clr3/&clr4,&clr5" IN YOUR MAIN PROGRAM
* TO RETURN TO THE COLOR VALUES SET HERE
SET TALK OFF
SET BELL OFF
STORE .F. TO leave
STORE CHR(30) TO arrowhead
STORE CHR(179) TO arrowstem
STORE 51 TO pos
* INITIALIZE nclr1 THRU nclr4 WITH "NORMAL" COLORS, NO BORDER
STORE clr1 TO nclr1
STORE clr2 TO nclr2
STORE clr3 TO nclr3
STORE clr4 TO nclr4
DO WHILE .T.
SET COLOR TO &nclr1/&nclr2,&nclr3/&nclr4,&clr5
CLEAR
* LIST CHOICES (BEFORE LOOP TO INCREASE SPEED)
@ 4,22 SAY 'SET COLOR TO C1 / C2, C3 / C4, C5'
@ 5,pos SAY arrowhead
@ 6,pos SAY arrowstem
@ 8,32 SAY ' Color Choices'
@ 9,32 SAY '---------------'
SET COLOR TO /B
@ 10,34 SAY '1 - BLACK '
SET COLOR TO B/W
@ 11,34 SAY '2 - BLUE '
SET COLOR TO G/B
@ 12,34 SAY '3 - GREEN '
SET COLOR TO BG/B
@ 13,34 SAY '4 - CYAN '
SET COLOR TO R/B
@ 14,34 SAY '5 - RED '
SET COLOR TO BR/B
@ 15,34 SAY '6 - MAGENTA'
SET COLOR TO GR/B
@ 16,34 SAY '7 - YELLOW '
SET COLOR TO W/B
@ 17,34 SAY '8 - WHITE '
SET COLOR TO &nclr1/&nclr2,&nclr3/&nclr4,&clr5
@ 20,10 SAY '(Q to Quit, M for Mono, R to Redo screen, S to Save choices)'
@ 22,13 SAY 'C1, C2 control standard foreground, background colors,'
@ 23,13 SAY 'C3, C4 control enhanced foreground, background colors,'
@ 24,25 SAY 'C5 controls border color'
* STORE WORDS TO ENHANCED COLORS EXAMPLE TEXT
STORE 'ENHANCED COLORS' TO example
DO WHILE .T.
SET COLOR TO &clr1/&clr2,&clr3/&clr4,&clr5
@ 1,16 SAY ' '
@ 2,16 SAY ' FOREGROUND COLORS' GET example
@ 2,34 SAY ' '
@ 2,50 SAY ' '
@ 2,51 SAY 'BORDER COLOR '
@ 3,16 SAY ' '
SET COLOR TO &nclr1/&nclr2,&nclr3/&nclr4,&clr5
CLEAR GETS
DO WHILE .T.
@ 5,pos SAY arrowhead
@ 6,pos SAY arrowstem
STORE ' ' TO choice
@ 19,9 SAY 'Enter color choice, or "<" or ">" to select color variable :';
GET choice PICTURE "!"
READ
DO CASE
CASE choice = '<'
IF pos <> 36
@ 5,pos SAY ' '
@ 6,pos SAY ' '
STORE pos - 5 TO pos
STORE VAL(SUBSTR(colornum,4,1)) - 1 TO newnum
STORE 'clr' + STR(newnum,1) TO colornum
LOOP
ELSE
? CHR(7)
LOOP
ENDIF
CASE choice = '>'
IF pos <> 56
@ 5,pos SAY ' '
@ 6,pos SAY ' '
STORE pos + 5 TO pos
STORE VAL(SUBSTR(colornum,4,1)) + 1 TO newnum
STORE 'clr' + STR(newnum,1) TO colornum
LOOP
ELSE
? CHR(7)
LOOP
ENDIF
CASE choice <> '>' .AND. choice <> '<'
EXIT
ENDCASE
ENDDO
DO CASE
CASE choice = '1'
STORE ' ' TO &colornum
CASE choice = '2'
STORE 'B' TO &colornum
CASE choice = '3'
STORE 'G' TO &colornum
CASE choice = '4'
STORE 'BG' TO &colornum
CASE choice = '5'
STORE 'R' TO &colornum
CASE choice = '6'
STORE 'BR' TO &colornum
CASE choice = '7'
STORE 'GR' TO &colornum
CASE choice = '8'
STORE 'W' TO &colornum
CASE choice = 'Q'
SET COLOR TO &clr1/&clr2,&clr3/&clr4,&clr5
STORE .T. TO leave
EXIT
CASE choice = 'M'
STORE 'W' TO clr1
STORE ' ' TO clr2
STORE ' ' TO clr3
STORE 'W' TO clr4
STORE ' ' TO clr5
EXIT
CASE choice = 'R'
STORE clr1 TO nclr1
STORE clr2 TO nclr2
STORE clr3 TO nclr3
STORE clr4 TO nclr4
EXIT
CASE choice = 'S'
* SAVE TO UTILFILE
* (SAVE SETTINGS TO A MEMORY FILE)
EXIT
OTHERWISE
? CHR(7)
LOOP
ENDCASE
* (choice)
ENDDO
* (DO WHILE .T.)
IF leave
EXIT
ENDIF
ENDDO
* (DO WHILE .T.)
* EOF - SETCOLOR.PRG